//
//  XKMineFunctionCollectionCell.m
//  XKJY
//
//  Created by xuyaguang on 2017/1/12.
//  Copyright © 2017年 xiaokang100. All rights reserved.
//

#import "XKMineAssetsCollectionCell.h"

@interface XKMineAssetsCollectionCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *textLabel;

@end
@implementation XKMineAssetsCollectionCell
#pragma mark - 重写构造方法
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
        [self initSubviews];
        [self addConstraints];
    }
    return self;
}

#pragma mark - 设置自身
- (void)setupUI{
    self.backgroundColor = WhiteColor;
    UIView *selectedView = [UIView new];
    selectedView.backgroundColor = kBaseGrayColor;
    self.selectedBackgroundView = selectedView;
}

#pragma mark - 创建控件
- (void)initSubviews {
    
    _titleLabel = [UILabel getLabWithText:@"--"
                                 textFont:Font_15
                                textColor:UIColorFromRGB(0xBBBBBB)
                            textAlignment:NSTextAlignmentLeft];
    
    _textLabel = [UILabel getLabWithText:@"--"
                                 textFont:Font_17
                                textColor:BlackColor
                            textAlignment:NSTextAlignmentLeft];
    
}
#pragma mark - 添加约束
- (void)addConstraints {
    
    [self.contentView addSubview:self.textLabel];
    [self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(10*Scale_W);
        make.centerX.mas_equalTo(self.contentView);
    }];
    
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView);
        make.bottom.mas_equalTo(self.contentView).offset(-10*Scale_H);
    }];
    
    
}


- (void)setTitleString:(NSString *)titleString {
    _titleString = titleString;
    _titleLabel.text = titleString;
}

- (void)setTextString:(NSString *)textString {
    _textString = textString;
    _textLabel.text = [NSString changeNumberFormat:NSNumberFormatterDecimalStyle withNumber:textString];
}

@end
